package lab4;

import java.util.Scanner;

public class Zad1 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		int n, m;
		Scanner sc = new Scanner(System.in);
		n=sc.nextInt();
		m=sc.nextInt();
		for (int i = 1; i <= m; i ++)
		{
			for (int j = 0; j < n; j ++)
			{
				System.out.print((i+j*m)+" ");
			}
			System.out.println();
		}
	}

}
